# 用来响应用户/ｐｙｔｈｏｎ请求
from abc import ABC

from tornado.web import RequestHandler

from views.ViewRouterInterface import ViewRouterInterface


class PythonHandler(ViewRouterInterface, RequestHandler, ABC):
    def get(self, *args, **kwargs):
        # write可以有多个，不会出现覆盖的情况
        self.write('你好， 拍森')
        self.write('<br>')
        self.write('<a href=%s>Jump To Java</a>' % self.reverse_url('java_url'))  # 反向url解析，对应application中的路由

    def post(self, *args, **kwargs):
        pass

    # 路由
    def configRouter(self):
        return [
            ('/python', PythonHandler)
        ]
